Skip to content

opentelemetry-exporter-otlp-common: add shared package for common OTLP utilities#5252

Open
herin049 wants to merge 16 commits into
open-telemetry:mainfrom
herin049:feat/exporter-http-common
Open

opentelemetry-exporter-otlp-common: add shared package for common OTLP utilities#5252
herin049 wants to merge 16 commits into
open-telemetry:mainfrom
herin049:feat/exporter-http-common

Conversation

@herin049

@herin049 herin049 commented May 28, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds a new opentelemetry-exporter-otlp-common package to provide common utilities for OTLP Protobuf/JSON/gRPC exporters.

Fixes: #5339

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

uv run tox -e py314-test-opentelemetry-exporter-otlpcommon-latest

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@github-actions

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment.
If you're still working on this, please add a comment or push new commits.

@github-actions github-actions Bot added the Stale label Jun 12, 2026
@herin049 herin049 force-pushed the feat/exporter-http-common branch from 44a17f2 to 5cb779f Compare June 16, 2026 02:36
@herin049 herin049 changed the title feat: add opentelemetry-exporter-otlp-http-common package opentelemetry-exporter-otlp-common: add shared package for common OTLP utilities Jun 16, 2026
@herin049 herin049 added exporters and removed Stale labels Jun 16, 2026
@herin049 herin049 marked this pull request as ready for review June 16, 2026 02:38
@herin049 herin049 requested a review from a team as a code owner June 16, 2026 02:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new opentelemetry-exporter-otlp-common package intended to centralize shared OTLP exporter utilities (notably OTLP/HTTP retry/compression logic and metrics aggregation/temporality helpers), and wires it into the monorepo build/test/CI configuration.

Changes:

  • Added the new opentelemetry-exporter-otlp-common distribution with internal OTLP/HTTP client + aggregation utilities and accompanying tests.
  • Integrated the new package into workspace membership, packaging lists, tox envs, and GitHub Actions test/lint jobs.
  • Added pinned test requirement sets (oldest/latest) for the new package and updated the changelog entry.

Reviewed changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
uv.lock Adds the new package as a workspace member and records dependency lock updates.
tox.ini Adds test/lint envs and dependency mappings for the new package.
pyproject.toml Includes/excludes the new package paths for repo-level tooling.
eachdist.ini Adds the new distribution to per-dist packaging configuration.
.github/workflows/test.yml Adds CI test jobs for the new package across Python versions/platforms.
.github/workflows/lint.yml Adds CI lint job for the new package.
.changelog/5252.added Documents the addition of the new shared OTLP utilities package.
exporter/opentelemetry-exporter-otlp-common/pyproject.toml Defines the new distribution metadata, deps, and build configuration.
exporter/opentelemetry-exporter-otlp-common/README.rst Documents installation and basic usage for the new OTLP/HTTP utilities.
exporter/opentelemetry-exporter-otlp-common/LICENSE Adds the Apache 2.0 license text for the new package directory.
exporter/opentelemetry-exporter-otlp-common/src/.../_http.py Implements OTLPHTTPClient (compression + retry/backoff + transport integration).
exporter/opentelemetry-exporter-otlp-common/src/.../_aggregation.py Implements env-driven metrics temporality + histogram aggregation selection helpers.
exporter/opentelemetry-exporter-otlp-common/src/.../__init__.py Initializes the new package module.
exporter/opentelemetry-exporter-otlp-common/src/.../version/__init__.py Introduces version metadata for the new distribution.
exporter/opentelemetry-exporter-otlp-common/src/.../py.typed Marks the package as typed for type checkers.
exporter/opentelemetry-exporter-otlp-common/tests/test_http_client.py Adds unit tests for retry, timeout, compression, and shutdown behaviors.
exporter/opentelemetry-exporter-otlp-common/tests/test_aggregation.py Adds unit tests for env-driven temporality/aggregation selection.
exporter/opentelemetry-exporter-otlp-common/tests/__init__.py Test package marker for the new package.
exporter/opentelemetry-exporter-otlp-common/test-requirements.in Defines test dependency inputs for the new package.
exporter/opentelemetry-exporter-otlp-common/test-requirements.oldest.txt Pinned “oldest” resolved test dependency set for CI/tox.
exporter/opentelemetry-exporter-otlp-common/test-requirements.latest.txt Pinned “latest” resolved test dependency set for CI/tox.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread exporter/opentelemetry-exporter-otlp-common/README.rst Outdated
Comment thread tox.ini

@aabmass aabmass left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, would appreciate your approval @DylanRussell

Comment on lines +51 to +52
# pylint: disable-next=broad-exception-caught
except Exception:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why try/except here ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case the retry-after value is invalid and/or result.headers() throws due to invalid/malformed response headers.

@aabmass aabmass moved this to Approved PRs that need fixes in Python PR digest Jun 25, 2026
@aabmass aabmass enabled auto-merge June 26, 2026 16:39
@aabmass aabmass moved this from Approved PRs that need fixes to Ready for merge in Python PR digest Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Ready for merge

Development

Successfully merging this pull request may close these issues.

OTLP/HTTP exporters should honor Retry-After

4 participants